<?php
//get the last-modified-date of this very file
$lastModified=filemtime(__FILE__);
//get a unique hash of this file (etag)
$etagFile = md5_file(__FILE__);
//get the HTTP_IF_MODIFIED_SINCE header if set
$ifModifiedSince=(isset($_SERVER['HTTP_IF_MODIFIED_SINCE']) ? $_SERVER['HTTP_IF_MODIFIED_SINCE'] : false);
//get the HTTP_IF_NONE_MATCH header if set (etag: unique file hash)
$etagHeader=(isset($_SERVER['HTTP_IF_NONE_MATCH']) ? trim($_SERVER['HTTP_IF_NONE_MATCH']) : false);

header("Content-Type:text/html; charset=utf-8");
//set last-modified header
header("Last-Modified: ".gmdate("D, d M Y H:i:s", $lastModified)." GMT");
//set etag-header
header("Etag: $etagFile");
//make sure caching is turned on
header('Cache-Control: public');

//check if page has changed. If not, send 304 and exit
if (@strtotime($_SERVER['HTTP_IF_MODIFIED_SINCE'])==$lastModified || $etagHeader == $etagFile)
{
       header("HTTP/1.1 304 Not Modified");
       exit;
}

?>
<iframe FRAMEBORDER="no" ALLOWTRANSPARENCY="true" MARGINHEIGHT="0" MARGINWIDTH="0" style="border:1px solid #<?php echo $border_color;?>;background-color:#<?php echo $background_color;?>;overflow: hidden;" scrolling="no" width="<?php echo $width;?>px" height="<?php echo $height;?>px" src="http://adsense.clicking.com.tw/OLS/js/partnerADs.php?category=<?php echo $category;?>&meta_Keywords=&url_fontsize=8pt&desc_fontsize=9pt&title_fontsize=11pt&param_Keywords=&param_type=CLICKING_<?php echo $ads_size;?>_1&title_color=<?php echo $title_color;?>&desc_color=<?php echo $desc_color;?>&width=<?php echo $width;?>px&height=<?php echo $height; ?>px" ></iframe>